package com.ui.basic.assembler.administrative;

import java.util.List;

import com.common.basic.base.BaseAssembler;
import com.ui.basic.command.administrative.CommandCustomer;
import com.ui.basic.ibatis.model.admin.TblACustomer;

public class CustomerAssembler implements
		BaseAssembler<TblACustomer, CommandCustomer> {

	public CommandCustomer toDto(TblACustomer entity) {
		CommandCustomer dto = new CommandCustomer();
		dto.setId(entity.getId());
		dto.setFirstname(entity.getFirstname());
		dto.setSurname(entity.getSurname());
		dto.setDob(entity.getDob());
		dto.setAddress1(entity.getAddress1());
		dto.setAddress2(entity.getAddress2());
		dto.setSuburb(entity.getSuburb());
		dto.setPostalCode(entity.getPostalCode());
		dto.setState(entity.getState());
		dto.setCountryId(entity.getCountryId());
		dto.setEmail1(entity.getEmail1());
		dto.setEmail2(entity.getEmail2());
		dto.setHomephone(entity.getHomephone());
		dto.setWorkphone(entity.getWorkphone());
		dto.setMobile(entity.getMobile());
		dto.setIdnumber(entity.getIdnumber());
		dto.setIdentificationId(entity.getIdentificationId());
		
		return dto;
	}

	public List<CommandCustomer> toDtoList(List<TblACustomer> listEntity) {
		return null;
	}

	public TblACustomer toEntity(CommandCustomer dto) {
		TblACustomer entity = new TblACustomer();
		entity.setId(dto.getId());
		entity.setFirstname(dto.getFirstname());
		entity.setSurname(dto.getSurname());
		entity.setDob(dto.getDob());
		entity.setAddress1(dto.getAddress1());
		entity.setAddress2(dto.getAddress2());
		entity.setSuburb(dto.getSuburb());
		entity.setPostalCode(dto.getPostalCode());
		entity.setState(dto.getState());
		entity.setCountryId(dto.getCountryId());
		entity.setEmail1(dto.getEmail1());
		entity.setEmail2(dto.getEmail2());
		entity.setHomephone(dto.getHomephone());
		entity.setWorkphone(dto.getWorkphone());
		entity.setMobile(dto.getMobile());
		entity.setIdnumber(dto.getIdnumber());
		entity.setIdentificationId(dto.getIdentificationId());
		
		return entity;
	}
}
